﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Locator.Silverlight.Client.Models.InventoryServiceReference;
using System.Collections.ObjectModel;
using System.Linq;

namespace Locator.Silverlight.Client.Test
{
    public class MockInventoryService : IInventoryServiceAsync
    {
        public ObservableCollection<ProductListItem> GetProductsResult { get; set; }

        public ObservableCollection<Store> GetStoresResult { get; set; }

        public ObservableCollection<StoreWithInventory> GetInventoriesResult { get; set; }

        public void GetProductsForCurrentUserAsync()
        {
            if (this.GetProductsForCurrentUserCompleted != null)
            {
                this.GetProductsForCurrentUserCompleted(null, new GetProductsForCurrentUserCompletedEventArgs(new object[] { GetProductsResult }, null, false, null));
            }
        }

        public event EventHandler<GetProductsForCurrentUserCompletedEventArgs> GetProductsForCurrentUserCompleted;

        public void GetStoresForCurrentUserAsync()
        {
            if (this.GetStoresForCurrentUserCompleted != null)
            {
                this.GetStoresForCurrentUserCompleted(null, new GetStoresForCurrentUserCompletedEventArgs(new object[] { GetStoresResult }, null, false, null));
            }
        }

        public event EventHandler<GetStoresForCurrentUserCompletedEventArgs> GetStoresForCurrentUserCompleted;

        public void GetInventoriesWithRequestAsync(InventoryRequest request)
        {
            if (request == null)
            {
                throw new NullReferenceException("request is null");
            }

            if (this.GetInventoriesWithRequestCompleted != null)
            {
                this.GetInventoriesWithRequestCompleted(null, new GetInventoriesWithRequestCompletedEventArgs(new object[] { GetInventoriesResult }, null, false, null));
            }
        }

        public event EventHandler<GetInventoriesWithRequestCompletedEventArgs> GetInventoriesWithRequestCompleted;

        public IAsyncResult BeginGetInventoriesWithRequest(InventoryRequest request, AsyncCallback callback, object asyncState)
        {
            throw new NotImplementedException();
        }

        public ObservableCollection<StoreWithInventory> EndGetInventoriesWithRequest(IAsyncResult result)
        {
            throw new NotImplementedException();
        }

        public IAsyncResult BeginGetStoresForCurrentUser(AsyncCallback callback, object asyncState)
        {
            throw new NotImplementedException();
        }

        public ObservableCollection<Store> EndGetStoresForCurrentUser(IAsyncResult result)
        {
            throw new NotImplementedException();
        }

        public IAsyncResult BeginGetProductsForCurrentUser(AsyncCallback callback, object asyncState)
        {
            throw new NotImplementedException();
        }

        public ObservableCollection<ProductListItem> EndGetProductsForCurrentUser(IAsyncResult result)
        {
            throw new NotImplementedException();
        }
    }
}